package com.z.redis.command.impl;

import com.z.redis.RedisCore;
import com.z.redis.command.Command;
import com.z.redis.command.CommandType;
import com.z.redis.resp.Resp;
import com.z.redis.resp.SimpleString;
import io.netty.channel.ChannelHandlerContext;

/**
 * 退出
 */
public class Quit implements Command {
    @Override
    public CommandType type(){
        return CommandType.quit;
    }
    @Override
    public void setContent(Resp[] array){}

    @Override
    public void handle(ChannelHandlerContext ctx, RedisCore redisCore){
        ctx.writeAndFlush(SimpleString.OK);
        ctx.close();
    }
}
